package com.robusta.app.web.controller;

import org.springframework.http.MediaType;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.ResponseBody;

@Controller
public class LifecycleController {
    @RequestMapping(value = "status", method = RequestMethod.GET, produces = MediaType.APPLICATION_JSON_VALUE)
    public @ResponseBody ApplicationStatusDTO applicationStatus() {
        return new ApplicationStatusDTO("active", "Application is active");
    }

    public static class ApplicationStatusDTO {
        public String status;
        public String message;

        public ApplicationStatusDTO(String status, String message) {
            this.status = status;
            this.message = message;
        }
    }
}
